from redis import *


if __name__ == '__main__':
    try:
        # 创建StrictRedis对象,与redis服务器简历连接
        sr = StrictRedis()
        # 添加键name,值为haha
        result=sr.set('name','haha')
        # 输出响应结果,如果添加成功则返回True,否则返回false
        print(result)
        # 其他略

    except Exception as e:
        print(e)


